#!/bin/sh

rm -rf *.pyc *.o *.so *_wrap.c
if [ $# -eq 1 ] && [ $1 == 'clean' ]
then
    exit 0
fi

gcc -fPIC -c example.c
ld -shared example.o -o libexample.so

swig -python example.i
gcc -fPIC -c example_wrap.c -I/usr/include/python2.7/
ld -shared example_wrap.o -lexample -L ./ -rpath ./ -o _example.so

#ld -shared example.o example_wrap.o -o _example.so
#ld -shared example.o -o example.so
